package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * Created by Administrator on 2016/9/12.
 */
public class QuizReportAction extends AHttpService<PbBean.PbResQuestionAddReport> {
    private int id;
    private String title;
    private String desc;
    private PbBean.PbSignBaseReportCategory reportCategory;


    private QuizReportAction(Context context, int id, String title, String desc, PbBean.PbSignBaseReportCategory reportCategory) {
        super(context);
        this.id = id;
        this.title = title;
        this.desc = desc;
        this.reportCategory = reportCategory;
    }

    public static QuizReportAction newInstance(Context context, int id, String title, String desc, PbBean.PbSignBaseReportCategory reportCategory) {
        return new QuizReportAction(context, id, title, desc, reportCategory);
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqQuestionAddReport.Builder builder = PbBean.PbReqQuestionAddReport.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setObjectId(id);
        builder.setTitle(title);
        builder.setDescription(desc);
        builder.setReportCategory(reportCategory);
        return apiService.quizReport(builder.build());
    }
}
